home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / gui / gengui.lha / GenGui / Examples / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-29  |  1.6 KB  |  64 lines

  1.  
  2. #include <stdlib.h>
  3. #include <proto/intuition.h>
  4. #include <intuition/intuition.h>
  5. #include <proto/exec.h>
  6. #include <proto/graphics.h>
  7.  
  8. #ifndef GUINAME
  9. #include "test.h"
  10. #else
  11. #include GUINAME
  12. #endif
  13.  
  14. extern struct IntuitionBase *IntuitionBase;
  15. extern struct GfxBase *GfxBase;
  16. extern struct Library *GadToolsBase;
  17.  
  18. main()
  19. {
  20.    struct IntuiMessage msg;
  21.    struct Window *win;
  22.    int run=1;
  23.  
  24.    win=OpenWindowTags(NULL,
  25.             WA_Left,0,WA_Top,20,
  26.             WA_Width,300,WA_Height,100,
  27.             WA_Title,TITLE,
  28.             WA_IDCMP,BUTTONIDCMP|IDCMP_CLOSEWINDOW|SLIDERIDCMP|
  29.                      IDCMP_NEWSIZE|IDCMP_REFRESHWINDOW,
  30.             WA_Flags,WFLG_SIZEGADGET|WFLG_DRAGBAR|WFLG_DEPTHGADGET
  31.                         |WFLG_SIMPLE_REFRESH
  32.                         |WFLG_CLOSEGADGET|WFLG_ACTIVATE,
  33.             WA_MinWidth,300,WA_MinHeight,100,
  34.             WA_MaxWidth,-1,WA_MaxHeight,-1,
  35.             TAG_DONE );
  36.  
  37.    if(!win) exit(0);
  38.  
  39.    if(RenderGui(win,&TestPro)) {CloseWindow(win);exit(0);}
  40.  
  41.    while(run) {
  42.       WaitPort(win->UserPort);
  43.       while(Gui_GetIMsg(win->UserPort,&msg)) {
  44.          switch(msg.Class) {
  45.             case IDCMP_CLOSEWINDOW: run=0;
  46.                                     break;
  47.             case IDCMP_NEWSIZE:     ResizeGui(&TestPro);
  48.                                     break;
  49.             case IDCMP_REFRESHWINDOW:
  50.                                     RefreshGui(&TestPro);
  51.                                     break;
  52.             case IDCMP_GADGETUP:
  53.                                     break;
  54.          }
  55.       }
  56.    }
  57.    FreeGui(&TestPro);
  58.    CloseWindow(win);
  59.    return(0);
  60. }
  61.  
  62.  
  63.  
  64.